/**
 * Created by hms on 2020-11-02.
 */
import RankAPI from '../api/rank.js'

export const DataCenter={
    state:{
        ranklist:[],
    },
    mutations:{
        setRankList(state,data){
            state.ranklist=data;
        }
    },
    actions:{
        loadRankList(context,data){
            RankAPI.getRankList(data).then(function(response){
                if(response.data.code==1){
                    context.commit('setRankList',response.data.data.list);
                }
            })
        }
    },
    getters:{
        getRankList:state => {
            return state.ranklist;
        }
    }
}
